package Case01.example03;

public class Student extends Person {
    public int no;

   public double scoreEn;

    public double scoreMath;

    public double scoreCh;

//    public double aver;
//
//    public   double max;
//
//    public double min;

    public int getNo() {
        return no;
    }

    public void setNo(int no) {
        this.no = no;
    }

    public double getScoreEn() {
        return scoreEn;
    }

    public void setScoreEn(double scoreEn) {
        this.scoreEn = scoreEn;
    }

    public double getScoreMath() {
        return scoreMath;
    }

    public void setScoreMath(double scoreMath) {
        this.scoreMath = scoreMath;
    }

    public double getScoreCh() {
        return scoreCh;
    }

    public void setScoreCh(double scoreCh) {
        this.scoreCh = scoreCh;
    }

//    public double getAver() {
//        return aver;
//    }
//
//    public void setAver(double aver) {
//        this.aver = aver;
//    }
//
//    public double getMax() {
//        return max;
//    }
//
//    public void setMax(double max) {
//        this.max = max;
//    }
//
//    public double getMin() {
//        return min;
//    }
//
//    public void setMin(double min) {
//        this.min = min;
//    }

    public Student(){
        super();
    }

    public double aver(){
        double a = (scoreEn+scoreMath+scoreCh)/3;
        return a;
    }
//最高分
    public double max(){
        double m = Math.max(Math.max(scoreCh,scoreEn),scoreMath);
        return m;
    }

    //最低分
    public double  min(){
        double m1 = Math.min(Math.min(scoreCh,scoreEn),scoreMath);
        return m1;
    }

//    public static void main(String[] args) {
//        Student student = new Student();
//        student.aver();
//        student.max();
//        student.min();
//
//    }
    @Override
    public String toString() {
        Student student = new Student();
        student.aver();
        student.max();
        student.min();
        return "Student{" +
                "no=" + no +
                ", scoreEn=" + scoreEn +
                ", scoreMath=" + scoreMath +
                ", scoreCh=" + scoreCh +
                ", aver=" + aver() +
                ", max=" + max() +
                ", min=" + min() +
                ", name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                ", age=" + age +
                '}';
    }

}
